package com.xbongbong.paas.model;

import com.xbongbong.outLink.domain.entity.OuterLinkEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface OuterLinkModel {

    List<OuterLinkEntity> findEntitys(Map<String, Object> param) throws XbbException;

    Long insert(OuterLinkEntity outerLinkEntity) throws XbbException;

    Integer update(OuterLinkEntity outerLinkEntity) throws XbbException;

    OuterLinkEntity getOuterLink(Long formId, Integer type, String corpid, Long dataId) throws XbbException;

    /**
     * 校验外链是否开启
     * @param formId
     * @param type
     * @param corpid
     * @return
     * @throws XbbException
     */
    boolean checkOuterLinkEnable(Long formId, Integer type, String corpid) throws XbbException;

    OuterLinkEntity getByTokenAndType(String token, Integer type) throws XbbException;

    Integer deleteByKey( Long key) throws XbbException;
}
